package com.xgc.book.bookserver.bean;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 图书表
 * </p>
 *
 * @author wrz
 * @since 2023-11-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "br_book", resultMap = "bookMap")
public class BookBean implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键自增
     */
    @TableId(value = "book_id", type = IdType.AUTO)
    private Integer bookId;

    /**
     * 图书名称
     */
    @TableField("book_name")
    private String bookName;

    /**
     * 作者编号(对应user_id)
     */
    @TableField("author_id")
    private Integer authorId;

    /**
     * 笔名
     */
    @TableField("author_name")
    private String authorName;

    /**
     * 评分，默认0
     */
    @TableField("score")
    private Integer score;

    /**
     * 评分次数，默认0
     */
    @TableField("score_count")
    private Integer scoreCount;

    /**
     * 图书封面
     */
    @TableField("cover")
    private String cover;

    /**
     * 图书简介
     */
    @TableField("profile")
    private String profile;

    /**
     * 1连载中2已完结
     */
    @TableField("book_status")
    private Integer bookStatus;

    /**
     * 状态1可用2禁用,默认1
     */
    @TableField("status")
    private Integer status;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 创建人
     */
    @TableField(value = "create_user", fill = FieldFill.INSERT)
    private Integer createUser;

    /**
     * 最后一次修改时间
     */
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 最后一次修改人
     */
    @TableField(value = "update_user", fill = FieldFill.UPDATE)
    private Integer updateUser;

    @TableField(exist = false)
    private UserinfoBean author;

    @TableField(exist = false)
    private List<CategoryBean> categoryList;

    @TableField(exist = false)
    private List<BookImageBean> imageList;

    @TableField(exist = false)
    private Integer[] categories;

    @TableField(exist = false)
    private String[] images;

}
